
package org.xteam.pascal.parser.ast;

public class DefaultPascalVisitor implements IPascalVisitor {

	public void visitProgram(Program aProgram) {
			aProgram.getName().visit(this);
			for (Identifier e : aProgram.getArguments()) {
				e.visit(this);
			}
			aProgram.getBody().visit(this);
	}
	
	public void visitBlock(Block aBlock) {
			for (IntegerValue e : aBlock.getLabels()) {
				e.visit(this);
			}
			for (ConstantDefinition e : aBlock.getConstants()) {
				e.visit(this);
			}
			for (TypeDefinition e : aBlock.getTypes()) {
				e.visit(this);
			}
			for (VariableDeclaration e : aBlock.getVariables()) {
				e.visit(this);
			}
			for (FunctionDefinition e : aBlock.getFunctions()) {
				e.visit(this);
			}
			for (Statement e : aBlock.getStatements()) {
				e.visit(this);
			}
	}
	
	public void visitConstantDefinition(ConstantDefinition aConstantDefinition) {
			aConstantDefinition.getName().visit(this);
			aConstantDefinition.getValue().visit(this);
	}
	
	public void visitTypeDefinition(TypeDefinition aTypeDefinition) {
			aTypeDefinition.getName().visit(this);
			aTypeDefinition.getValue().visit(this);
	}
	
	public void visitVariableDeclaration(VariableDeclaration aVariableDeclaration) {
			for (Identifier e : aVariableDeclaration.getNames()) {
				e.visit(this);
			}
			aVariableDeclaration.getType().visit(this);
	}
	
	public void visitProcedure(Procedure aProcedure) {
			aProcedure.getName().visit(this);
			for (Parameter e : aProcedure.getParameters()) {
				e.visit(this);
			}
			aProcedure.getBody().visit(this);
	}
	
	public void visitFunction(Function aFunction) {
			aFunction.getName().visit(this);
			for (Parameter e : aFunction.getParameters()) {
				e.visit(this);
			}
			aFunction.getReturnType().visit(this);
			aFunction.getBody().visit(this);
	}
	
	public void visitVariableParameter(VariableParameter aVariableParameter) {
			aVariableParameter.getFlag().visit(this);
			for (Identifier e : aVariableParameter.getNames()) {
				e.visit(this);
			}
			aVariableParameter.getType().visit(this);
	}
	
	public void visitProcedureParameter(ProcedureParameter aProcedureParameter) {
			aProcedureParameter.getName().visit(this);
			for (Parameter e : aProcedureParameter.getParameters()) {
				e.visit(this);
			}
	}
	
	public void visitFunctionParameter(FunctionParameter aFunctionParameter) {
			aFunctionParameter.getName().visit(this);
			for (Parameter e : aFunctionParameter.getParameters()) {
				e.visit(this);
			}
			aFunctionParameter.getReturnType().visit(this);
	}
	
	public void visitVarFlag(VarFlag aVarFlag) {
	}
	
	public void visitReferenceType(ReferenceType aReferenceType) {
			aReferenceType.getName().visit(this);
	}
	
	public void visitArraySchemaType(ArraySchemaType aArraySchemaType) {
			for (Range e : aArraySchemaType.getRanges()) {
				e.visit(this);
			}
			aArraySchemaType.getType().visit(this);
	}
	
	public void visitPackedArraySchemaType(PackedArraySchemaType aPackedArraySchemaType) {
			aPackedArraySchemaType.getRange().visit(this);
			aPackedArraySchemaType.getType().visit(this);
	}
	
	public void visitRange(Range aRange) {
			aRange.getFrom().visit(this);
			aRange.getTo().visit(this);
			aRange.getStep().visit(this);
	}
	
	public void visitTypeReference(TypeReference aTypeReference) {
			aTypeReference.getName().visit(this);
	}
	
	public void visitEnumType(EnumType aEnumType) {
			for (Identifier e : aEnumType.getNames()) {
				e.visit(this);
			}
	}
	
	public void visitRangeType(RangeType aRangeType) {
			aRangeType.getFrom().visit(this);
			aRangeType.getTo().visit(this);
	}
	
	public void visitPointerType(PointerType aPointerType) {
			aPointerType.getType().visit(this);
	}
	
	public void visitArrayType(ArrayType aArrayType) {
			aArrayType.getFlag().visit(this);
			aArrayType.getType().visit(this);
			for (Type e : aArrayType.getIndexes()) {
				e.visit(this);
			}
	}
	
	public void visitRecordType(RecordType aRecordType) {
			aRecordType.getFlag().visit(this);
			aRecordType.getBody().visit(this);
	}
	
	public void visitFieldsAndVariant(FieldsAndVariant aFieldsAndVariant) {
			for (Field e : aFieldsAndVariant.getFields()) {
				e.visit(this);
			}
			aFieldsAndVariant.getVariant().visit(this);
	}
	
	public void visitRecordCase(RecordCase aRecordCase) {
			aRecordCase.getSelector().visit(this);
			for (RecordCaseArm e : aRecordCase.getArms()) {
				e.visit(this);
			}
	}
	
	public void visitVariantSelector(VariantSelector aVariantSelector) {
			aVariantSelector.getName().visit(this);
			aVariantSelector.getType().visit(this);
	}
	
	public void visitRecordCaseArm(RecordCaseArm aRecordCaseArm) {
			for (Expression e : aRecordCaseArm.getValues()) {
				e.visit(this);
			}
			aRecordCaseArm.getBody().visit(this);
	}
	
	public void visitField(Field aField) {
			for (Identifier e : aField.getNames()) {
				e.visit(this);
			}
			aField.getType().visit(this);
	}
	
	public void visitSetType(SetType aSetType) {
			aSetType.getFlag().visit(this);
			aSetType.getType().visit(this);
	}
	
	public void visitFileType(FileType aFileType) {
			aFileType.getFlag().visit(this);
			aFileType.getType().visit(this);
	}
	
	public void visitPackedFlag(PackedFlag aPackedFlag) {
	}
	
	public void visitEmptyStatement(EmptyStatement aEmptyStatement) {
	}
	
	public void visitLabelStatement(LabelStatement aLabelStatement) {
			aLabelStatement.getLabel().visit(this);
			aLabelStatement.getStatement().visit(this);
	}
	
	public void visitAssignment(Assignment aAssignment) {
			aAssignment.getVariable().visit(this);
			aAssignment.getExpression().visit(this);
	}
	
	public void visitFunctionCall(FunctionCall aFunctionCall) {
			aFunctionCall.getName().visit(this);
			for (Expression e : aFunctionCall.getParameters()) {
				e.visit(this);
			}
	}
	
	public void visitGoto(Goto aGoto) {
			aGoto.getLabel().visit(this);
	}
	
	public void visitCompound(Compound aCompound) {
			for (Statement e : aCompound.getStatements()) {
				e.visit(this);
			}
	}
	
	public void visitIf(If aIf) {
			aIf.getCondition().visit(this);
			aIf.getThenStatement().visit(this);
			aIf.getElseStatement().visit(this);
	}
	
	public void visitCase(Case aCase) {
			aCase.getCondition().visit(this);
			for (CaseArm e : aCase.getArms()) {
				e.visit(this);
			}
	}
	
	public void visitCaseArm(CaseArm aCaseArm) {
			for (Expression e : aCaseArm.getConstants()) {
				e.visit(this);
			}
			aCaseArm.getStatement().visit(this);
	}
	
	public void visitRepeatUntil(RepeatUntil aRepeatUntil) {
			aRepeatUntil.getCondition().visit(this);
			for (Statement e : aRepeatUntil.getStatements()) {
				e.visit(this);
			}
	}
	
	public void visitWhile(While aWhile) {
			aWhile.getCondition().visit(this);
			aWhile.getStatement().visit(this);
	}
	
	public void visitFor(For aFor) {
			aFor.getVariable().visit(this);
			aFor.getFrom().visit(this);
			aFor.getTo().visit(this);
			aFor.getDir().visit(this);
			aFor.getStatement().visit(this);
	}
	
	public void visitWith(With aWith) {
			for (Access e : aWith.getVariables()) {
				e.visit(this);
			}
			aWith.getStatement().visit(this);
	}
	
	public void visitUpFlag(UpFlag aUpFlag) {
	}
	
	public void visitDownFlag(DownFlag aDownFlag) {
	}
	
	public void visitVariableAccess(VariableAccess aVariableAccess) {
			aVariableAccess.getName().visit(this);
	}
	
	public void visitArrayAccess(ArrayAccess aArrayAccess) {
			aArrayAccess.getExpression().visit(this);
			for (Expression e : aArrayAccess.getIndexes()) {
				e.visit(this);
			}
	}
	
	public void visitFieldAccess(FieldAccess aFieldAccess) {
			aFieldAccess.getExpression().visit(this);
			aFieldAccess.getName().visit(this);
	}
	
	public void visitPointerAccess(PointerAccess aPointerAccess) {
			aPointerAccess.getExpression().visit(this);
	}
	
	public void visitEqualsExpression(EqualsExpression aEqualsExpression) {
	}
	
	public void visitNotEqualsExpression(NotEqualsExpression aNotEqualsExpression) {
	}
	
	public void visitLowerThanExpression(LowerThanExpression aLowerThanExpression) {
	}
	
	public void visitGreaterThanExpression(GreaterThanExpression aGreaterThanExpression) {
	}
	
	public void visitLowerOrEqualsExpression(LowerOrEqualsExpression aLowerOrEqualsExpression) {
	}
	
	public void visitGreaterOrEqualsExpression(GreaterOrEqualsExpression aGreaterOrEqualsExpression) {
	}
	
	public void visitInExpression(InExpression aInExpression) {
	}
	
	public void visitAddExpression(AddExpression aAddExpression) {
	}
	
	public void visitSubExpression(SubExpression aSubExpression) {
	}
	
	public void visitOrExpression(OrExpression aOrExpression) {
	}
	
	public void visitMulExpression(MulExpression aMulExpression) {
	}
	
	public void visitDivExpression(DivExpression aDivExpression) {
	}
	
	public void visitIntegralDivExpression(IntegralDivExpression aIntegralDivExpression) {
	}
	
	public void visitModuloExpression(ModuloExpression aModuloExpression) {
	}
	
	public void visitAndExpression(AndExpression aAndExpression) {
	}
	
	public void visitNegateExpression(NegateExpression aNegateExpression) {
			aNegateExpression.getExpression().visit(this);
	}
	
	public void visitNotExpression(NotExpression aNotExpression) {
			aNotExpression.getExpression().visit(this);
	}
	
	public void visitFormatExpression(FormatExpression aFormatExpression) {
			aFormatExpression.getExpr().visit(this);
			aFormatExpression.getWidth().visit(this);
			aFormatExpression.getTo().visit(this);
	}
	
	public void visitIdentifierExpression(IdentifierExpression aIdentifierExpression) {
	}
	
	public void visitStringExpression(StringExpression aStringExpression) {
	}
	
	public void visitNumberExpression(NumberExpression aNumberExpression) {
	}
	
	public void visitIntegerExpression(IntegerExpression aIntegerExpression) {
	}
	
	public void visitNilExpression(NilExpression aNilExpression) {
	}
	
	public void visitFuncallExpression(FuncallExpression aFuncallExpression) {
			aFuncallExpression.getName().visit(this);
			for (Expression e : aFuncallExpression.getArguments()) {
				e.visit(this);
			}
	}
	
	public void visitIdentifier(Identifier aIdentifier) {
	}
	
	public void visitIntegerValue(IntegerValue aIntegerValue) {
	}
	
}
